package day03;

/**
 * @author wangzhisen
 * @Desc TODO
 * @date 2025/4/10
 */
//练习4：有口井7米深，一只青蛙白天爬3米，晚上坠下2米，问这青蛙几天才能爬出这口井(while)
public class CycleDemo4 {
    public static void main(String[] args) {
        int s=0;
        int days=0;
        while(true){
            days++;
            s+=3;
            if(s>=7){
                System.out.println("跳出");
                break;
            }
            s-=2;
        }
        System.out.println("爬出天数为："+days);
    }
}
